package com.BlogPark.mapper;

import com.BlogPark.pojo.DetailsUser;
import com.BlogPark.pojo.User;
import org.apache.ibatis.annotations.Param;


import java.util.List;


public interface UserMapper {
    /**
     * 用户登录
     * @param username
     * @param password
     * @return
     */
    User Login(@Param("username") String username, @Param("password")String password);


    /**
     * 绑定注册/重置密码
     * @param user
     * @return
     */
    int AddUserOrUpdatePWD(User user);


    /**
     * 检查
     * @param user
     * @return
     */
    List<User> checkout(User user);


    /**
     *checkoutuser
     * @param email
     * @return
     */
    User selectUserByEmail(String email);

    /**
     * 登录状态
     * @param email
     * @return
     */
    int statusOn(String email);

    /**
     * 登出状态
     * @param email
     * @return
     */
    int statusOff(String email);
    /**
     *修改用户名和密码
     * @param user
     * @return
     */
    int updateUser(User user);


    /**
     * 绑定emaill
     * @param user
     * @return
     */
    int addUser(User user);


    /**
     * 更新链接码值
     * @param user
     * @return
     */
    int updateCodeAndDate(User user);


    /**
     *
     * @param userId
     * @return
     */
    DetailsUser searchById(Integer userId);


    /**
     * 激活用户
     * @param email
     * @return
     */
    int doActivCode(String email);
}
